<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>canvastext</title>
    <script type="text/javascript">
        window.onload=function () {
            var can=document.getElementById("my");
            var con=can.getContext("2d");
            con.fillStyle="#0000ff";
            con.fillRect(0,0,800,230);
            con.fillStyle="#fff";
            con.strokeStyle="#fff";
            con.font="bold 60px '微软雅黑'";
            con.textBaseline="top";
            con.textAlign="start";
            con.strokeText("叮叮书店",40,10);
            con.font="bold 40px '微软雅黑'";
            con.fillText("叮叮书店是一个网上书店。",40,80);
            con.fillText("叮叮书店是一个网上书店。",370,150,360);
        }
    </script>
</head>
<body>
<canvas id="my" width="800px" height="230px"></canvas>
</body>
</html>